/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

import { DispatcherType } from '../enum/dispatcher-type.js';

import { Dispatcher } from './dispatcher.js';
import { LoopPriorityDispatcher } from './loop-priority-dispatcher.js';

/**
 * 分发器工厂
 * 创建不同类型的分发器
 *
 * @since 2022/8/16
 */
export class DispatcherFactory {
  static getDispatcher(type: DispatcherType): Dispatcher | undefined {
    if (type === DispatcherType.LOOP_PRIORITY) {
      return new LoopPriorityDispatcher();
    }
    return undefined;
  }
}
